package com.example.tester2;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.text.Html;
import android.text.method.ScrollingMovementMethod;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

public class Help extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_help);
		TextView mTextView = (TextView)this.findViewById(R.id.textView01);
		mTextView.setText("Welcome to the help page. please select an above option.");
		mTextView.setMovementMethod(new ScrollingMovementMethod());
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.help, menu);
		return true;
	}
	//back button
	public void goBack(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, MainActivity.class);
		startActivity(intent);
	}
	//back button
	public void textHelp(View view) {
		TextView t =(TextView)this.findViewById(R.id.textView01); 
		t.scrollTo(0, 0);
	    t.setText(Html.fromHtml("<p><h1><b>App Tutorial</b></h1></p>" +
		"<u>How to Enter a Tapped Tree?</u><br>" + 
		"<p>Entering the tree tap data is probably the most important tool for using this application. There may be some terminology to help categorize your taps like “Tree Type,” “Circumference,” or “Sap Yield.”</p>" +
		"<p><b>Plot Name</b> is a name attributed to the plot by you. It will help distinguish which records belong to which trees.</p>" +
		"<p><b>Tree Type</b> is simply to help distinguish the trees; it is a completely optional open entry box. This means that you do not have to complete this if you do not know or care to enter the tree type. If trees are of multiple species enter the majority species.</p>" +
		"<p><b>Number of trees</b> is simply the number of tapped trees whose data being entered.</p>" +
		"<p><b>Circumference</b> provides a box to enter the measurement of the tree’s perimeter.  You can get the circumference by taking a measuring tape in one hand (holding it at 0) and wrapping it around the tree starting.  The number it increases towards is the circumference. <u>this app suggests using inches as a standard measure</u> but you may record using other measurements with this app if you so choose.</p>" + 
		"<p><b>Sap Yield</b> is the amount of sap produced from the tree tap.  You can measure this by a typical household measuring cup. <u>this app suggests using cups as a standard measure</u> but you may record using whatever measurements you choose using this app</p>" + 
		"<p><h2>Entering Data</h2></p> <p>In order to enter data, you simply touch “Enter Data” from the home screen.  By selecting “Enter Data,” it will open up to a page with a heading that reads “Tap Entry.”</p>" + 
		"<p>“Tap Entry” has all the content to enter data of your taps.<br>  1. First, enter the type of tree, number of trees, and plot name. Ex. Sugar Maple, 3, 'my sugarbush' <br> 2. Second, enter the number of taps used for all trees <br> 3. Third, find the circumference by measurement or estimation. Enter the average circumfrance of all trees tapped. <br> 4. Finally, enter the sap yield which can help estimate the amount of syrup or sugar which will be produced. (you can return to a record from the 'records' page to add this data in later once you have finished tapping the plot for the season)</p>" +
		"<p><u>Where can I see my previous Taps?</u><br> From the homepage, just touch “<b>Records.</b>” </p>" + 
		"<p>the <b>Records</b> page give the user a nice listed layout of their previous taps by date.  This is a great tool to view when you started a tap, and it can keep track of the sap yield.  This page connects with the Tap Entry page by organizing all the content.  </p>"));
	}
	//back button
	public void textTap(View view) {
		TextView t =(TextView)this.findViewById(R.id.textView01); 
		t.scrollTo(0, 0);
	    t.setText(Html.fromHtml("<p><h1><b>Tree Tapping Tutorial</b></h1></p>" +
	    		"<b>Definitions:</b> <br>" +
	    		"•<b>Maple sap</b> – clear liquid that comes out of maple trees <br>" +
	    		"•<b>Maple syrup</b> – refined liquid that people eat on pancakes <br>" +
	    		"•<b>Sugarbush</b> – woodlot that is tapped to produced maple syrup <br>" +
	    		"•<b>Tap</b> – tube used to collect maple sap from tree <br>" +
	    		"•<b>Sugarshack</b> – building where sap is turned into syrup <br>" +
	    		"•<b>Tap Spile</b> - tool used to extract sap from a maple tree <br>" +
	    		"<p><b><u>Tools to Tap a tree:</b></u> It is important that you have all your equipment with when the sap is flowing.</p>" + 
                "<p><u>Primary tools:</u></p>"+
	    		"<b>Buckets:</b> Used to collect the sap as it drips from the spile. <br>"+
	    		"<b>Lids:</b>  Attached  to  the  top  of  the  bucket   to  prevent  rain,  snow,  and  foreign material from entering the bucket. <br>"+ 
	    		"<b>Drill Bit:</b> Depending  upon the type  of  spile  used, either a  5/16 or 7/16 drill bit is used to drill the tap hole into your maple tree. <br>"+ 
	    		"<b>Tap: (spile)</b> is inserted into the drilled hole to transfer sap into the bucket.<br>" + 
	    		"<b>Hooks:</b> Hooks are attached to the spile and used to hang the bucket.<br>"+ 
	    		"<b>Cheesecloth:</b>  Used  to  filter  any  solids  (such  as  pieces  of  bark) when transferring sap from the collection bucket to a storage container. <br> " +
	    		"<p><u>Secondary tools:</u> </p>" + "<b>Hammer:</b> Used to gently tap the spile into the tap hole. <br>" +
	    		"<b>Pliers:</b> Used to remove the tap from the tree once the sap season is over. <br>" +
	    		"<b>Storage  Containers:</b>  Food  grade  storage  containers  are  used  to  store  your collected  sap.  Clean  plastic milk  jugs  or juice  containers may  be used. You can also  use  food  grade 5 gallon buckets. Your local deli or donut shop may provide these free of charge as they often receive their ingredients in such containers. <br>" +
	    		"<p><b><u>Tree Tapping</b></u></p>" + "<p>The time for tree tapping depends on where you live and the temperatures. Sap flows when temperatures  are  above  32  degrees  Fahrenheit,  and  at  night  temperatures  are  below freezing.  It  is  important   that  temperatures  are between  this  range so make sure  you have an outdoors  thermometer.  The pressure caused when the temperature changes keeps the sap flowing.</p>"+
	    		"<p>The diameter of  the  tree  is important, select  trees  that  are at least 12 inches in diameter. Additionally,  select trees with the greatest exposure to sunlight.You can tap a particular tree two or  three times,  depending  upon its size.   The  measurement must be  taken  at a height of  four  feet  above  ground  level,  there  are  three  different  ways  you  can  use  to  measure tree:</p>" +
	    		"<p><b>1.</b> For  an estimate, hold  a metre stick up. One end of the metre stick should be placed approximately  at  the  edge  of  the  tree  trunk.  Hold  the  stick  steady  and  read  the number at the other edge of the tree trunk to approximate the diameter of the tree.</p>" +
	    		"<p><b>2.</b> Use  a  measuring  tape  around  the  trunk  of  the  tree,  four  feet  above  ground  level. Determine  the  circumference  of  the  tree  (To  convert  the  circumference diameter, divide the circumference by 3.1416.) </p>" +
	    		"<p><b>3.</b> Get  a  rope  of  35­45  inches  long.  Tight  a  knot at  12 inches,  other  at  21 inches  andanother  at 30  inches.  Wrap  it  around the tree and this will give you a rough estimate of how many taps you can use per tree.  </p>" + 
	    		"<b>Diameter     /                                   Number of Taps </b><br>" + 
	    		"12­-20 inches  :                                              1 <br>" + 
	    		"21­-27 inches  :                                              2 <br>" +
	    		"27 or more inches  :                                     3 <br><br>" + 
	    		"<p><u>Next:</u></p>"+ 
	    		"<p>Drill  the  tap  hole:  the  size  of  the  whole  depends  on  the  size  of  the  spile  you  are going to use to tap the tree. Drill into the sunniest side of the tree trunk.</p>" + 
	    		"<p>If  the  sap  is  flowing, the  turnings will  appear  damp.  This is  a  good sign...  Drill the hole about 2 inches deep. </p>" + 
	    		"<p>Clean the hole and then insert the spile.</p>" +
	    		"<p>With a hammer Tap the spile firmly into the hole. </p>" + 
	    		"<p>Hang the bucket (3 to 5 gallons) to the spile. </p>" +
	    		"<p>Cover the bucket. </p>" + 
	    		"<p>Check the bucket every day. </p>" +
	    		"<p>Select  a  wide  shallow pan  to boil the sap in.  Boil it in high. The syrup is nearly done when it boils with an oily appearance. </p>" +
	    		"<p><u><b>How much Syrup and Sugar will you produce?</b></u></p>" + 
	    		"<p>After  the  boiling  process  (evaporation)  of  sap  out  of  30­50  gallons  of  sap  you will make one gallon of maple syrup. </p>" + 
	    		"<p>One gallon of syrup produces eight pounds of maple sugar. </p>"));
	}
	//back button
	public void textFAQ(View view) {
		TextView t =(TextView)this.findViewById(R.id.textView01); 
	    t.setText("@string/FAQ");
	}

}
